<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html>
<html lang="zh_cn">
<head>
    <meta charset="UTF-8">
    <title>机电维修管理系统后台</title>
<script src="${pageContext.request.contextPath}/js/jQuery.js"></script>
    <style>
        *{ 
        	padding:0; 
        	margin:0;
        }
        img{ 
        	display:block;
        }
        html{ width:100%; height:100%; font-family:"微软雅黑"; background-image:url(../images/bg.jpg); background-repeat:no-repeat; background-position:center; background-size:cover; position:relative;}

        .djzzlogo{ width:6%; height:2%; margin:2%;}

        .jituanlogo{ width:6%; height:6%; margin:4% auto 0 auto;}
        h1{ font-size:2vw; color:#FFFFFF; text-shadow:2px 2px 6px #101d3e; line-height:300%; font-weight:normal; text-align:center;  margin-bottom:5%;}
        /*登录*/
        #login input{ display: block; width:16vw; height:6vh; margin: 3vh auto; border-radius:4vh; border: 1px solid white; outline: none; padding-left:3.6vw; font-family:"微软雅黑"; font-size: 1.2vw; color:#FFFFFF; background:none; background-repeat: no-repeat; background-size: 4vh; background-position:1.5vh 1vh; opacity:0.7; -webkit-opacity:0.7;}
        #userType{
            display: block; 
            width:20vw; 
            height:6vh; 
            margin: 3vh auto; 
            border-radius:4vh; 
            border: 1px solid white; 
            outline: none; 
            padding-left:3.6vw; 
            font-family:"微软雅黑"; 
            font-size: 1.2vw; 
            color:#FFFFFF; 
            background:none; 
            background-repeat: no-repeat; 
            background-size: 4vh; 
            background-position:1.5vh 1vh; 
            opacity:0.7; 
            -webkit-opacity:0.7;
        }
        #login input,#userType:focus{ background-color:rgba(7,54,80,0.3); opacity:1;}
/*         #login input[type=text]{ background-image: url(/Image/zhanghao.png);}
        #login input[type=password]{ background-image: url(/Image/mima.png);} */
        #login input,#userType::-webkit-input-placeholder{color: white; opacity:0.6;}/*webkit内核 chrome safari*/
        #login input,#userType:-moz-placeholder{color: white; opacity:0.6;}/*firefox 18-*/
        #login input,#userType::-moz-placeholder{color: white; opacity:0.6;}/*webkit内核 firefox 19+*/
        #login input,#userType:-ms-input-placeholder{color: white; opacity:0.6;}/*ie10*/
        /*提示信息*/
        #login p{ width: 20vw; margin: 0 auto; font-size: 1vw; line-height:7vh; text-align:center; color:#FF0027;}
        /*登录按钮*/
        #login button{ display:block; width: 20vw; height:6vh; margin: 4vh auto 2vh auto; border: none; outline: none; border-radius:4vh; background-color: #3683a0; font-family:"微软雅黑"; font-size: 1.2vw; color: white; line-height:6vh; cursor:pointer; opacity:0.7; -webkit-opacity:0.7; }
        #login button:active{ opacity:0.5;}
        #login button:disabled{ background-color: #707070;}
    </style>
</head>
<body>
    <div class="content">
        <h1>忘记密码</h1>
        <div id="login">
         	<input type="text" id="userName" placeholder="请输入登陆账号" />
         	<input type="text" id="email" placeholder="请输入邮箱" />
            <input type="password" id="password" placeholder="请输入新密码" />
            <button id="save">重置密码</button>
        </div>
    </div>
</body>
<script >
$(function () {
    $("#save").click(function(){
	   		var userId = '<%=session.getAttribute("userId")%>';
			if ($("#password").val() == '') {
				alert("请输入密码");
				return false;
			} else if ($("#email").val() == '') {
				alert("请输入邮箱");
				return false;
			} else if ($("#userName").val() == '') {
				alert("请输入账号");
				return false;
			} else {
				$.ajax({
					type : "post",
					url : "/document/user/forgetPassword.do",
					data : {
						email : $("#email").val(),
						password : $("#password").val(),
						userName : $("#userName").val()
					},
					dataType : "JSON",
					success : function(t) {
						alert("密码重置成功");
						window.location.href = "/document/views/login.jsp"
						// t = eval('('+t+')');
						// if(t.code  == 1){  
						//      window.location.href = t.url; 
						// }else{  
						//     alert('用户名或密码错误');
						// }  
					}
				});
			}

		})
	});
</script>
</html>